#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int read(){
    int res=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        if(ch=='-') f=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        res=res*10+ch-'0';
        ch=getchar();
    }
    return res*f;
}
int n;
int a[N];
int c[N];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    n=read();
    for(int i=1;i<=n;i++) a[i]=read();
    sort(a+1,a+1+n);
    int cnt=1,t=0;
    for(int i=2;i<=n+1;i++){
        if(a[i]!=a[i-1]){
            c[++t]=cnt;
            cnt=1;
        }
        else cnt++;
    }
    int notdone=c[1],ans=n;
    for(int i=2;i<=t;i++){
        //printf("%d %d\n",c[i],notdone);
        if(c[i]>=notdone){
            ans-=notdone;
            notdone=c[i];
        }
        else{
            ans-=c[i];
        }
    }
    printf("%d\n",ans);
    return 0;
}